class_name UnitBaseData
extends Resource

# summon
@export var summon_source_item: ItemSpellSummonConfig = null

@export var config: UnitBaseConfig
@export var hp: int = 10
@export var max_hp: int = 10
@export var is_enemy: bool = true
@export var gold: int = 0

# level
@export var pos: Vector2 = Vector2.ZERO
@export var face: int = 1

# home position
@export var home_position: Vector2 = Vector2.ZERO

# allow waters
@export var allow_move_water_ids: Array[String] = []


func get_base_attack():
	return config.base_attack


func get_critical_rate():
	return config.base_critical_attack_rate

	
func get_critical_attack_bonus():
	return config.base_critical_attack_bonus
	

func get_base_defense():
	return config.base_defense
	
	
func get_anti_knockback():
	return config.base_anti_knockback


func add_hp(amount: int):
	hp += amount
	if hp >= max_hp:
		hp = max_hp
	
